package com.musicstore.entity;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class ShoppingCart {
	private List<CartItem> items=new ArrayList<CartItem>();

	public List<CartItem> getItems() {
		return items;
	}
	   //总计
	public BigDecimal  getAllTotal(){
		 BigDecimal sum=new BigDecimal(0);	 
		 for (CartItem item : items) {
			sum=sum.add(item.getSubTotal());
		}
		 return sum;
	}
}
